package imaa.escola.disciplina.repository;

import imaa.escola.disciplina.datatransfer.PesquisaDisciplinaDto;
import imaa.escola.disciplina.domain.Disciplina;
import imaa.framework.persistence.CustomRepository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

public interface DisciplinaRepository extends JpaRepository<Disciplina, Long>, CustomRepository<Disciplina, PesquisaDisciplinaDto>, DisciplinaRepositoryCustom {

	@Query("SELECT a FROM Disciplina a WHERE LOWER(DSC_DISCIPLINA) LIKE CONCAT('%', LOWER(:descricao), '%')")
    public List<Disciplina> findByName(@Param("descricao") String descricao);
}
